package com.szd.qiongyou20.home.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Debug;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;

import com.szd.qiongyou20.R;

/**
 * Created by SZD on 2016/12/15.
 */

public class ShowActivity extends AppCompatActivity {

    private Context mContext;
    private ImageView mImageView;
    private WebView mWebView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.show_activity);

        initView();
    }

    private void initView() {
        mImageView = (ImageView) findViewById(R.id.imageView_back);
        mImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });

        mWebView = (WebView) findViewById(R.id.webView_show);

        Intent intent = getIntent();
        String url = intent.getStringExtra("url");
        Log.i("得到的地址", "initView: ====="+ url);
        mWebView.loadUrl(url);

        // 设置
        mWebView.getSettings().setJavaScriptEnabled(true);
        mWebView.setWebViewClient(new WebViewClient());
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
    }
}
